" File:          triggertest.vim
" Author:        Rit Li
" Version:       0.1
" Description:   Send filename and line number to a named pipe

function! TriggerTest()
python << EOF
import os, vim
try:
    fd = os.open('triggertest.pipe', os.O_WRONLY | os.O_NONBLOCK)
    line = vim.eval('line(".")')
    fname = vim.eval('expand("%")')
    os.write(fd, "%s %s\n" % (fname, line))
    os.close(fd)
except OSError:
    pass
EOF
endfunction
